Performance.registerGroup({
	name: "js.array"
});

Performance.registerTest({
	group: "js.array",
	name: "join: -small -default-token",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = ["a", "b", "c", "d", "e"];
		while(arg--) {
			arr.join();
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "join: -small -dot-token",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = ["a", "b", "c", "d", "e"];
		while(arg--) {
			arr.join(".");
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "join: -standard",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"];
		while(arg--) {
			arr.join(".");
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "join: -complex",
	args: [25000, 50000, 100000],
	
	run: function(arg) {
		var arr = ["ania", ["ale", "nie", "ma", "mnie"], "ma", "kota", ["dada", "i", "ii", "iii", "costam"]];
		while(arg--) {
			for(var i = 0, l = arr.length; i < l; i++) {
				if(arr[i] instanceof window.Array) { arr[i] = arr[i].join(".");}
			}
			arr.join(".");
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "join: -standard -int-inside",
	args: [25000, 50000],
	
	run: function(arg) {
		var arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", 10];
		while(arg--) {
			arr.join(".");
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "join: -standard -int-only",
	args: [25000, 50000],
	
	run: function(arg) {
		var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
		while(arg--) {
			arr.join(".");
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "indexOf: -empty",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		while(arg--) {
			arr.indexOf("path");
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "indexOf: -standard",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"];
		while(arg--) {
			arr.indexOf("path");
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "concat: -small",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var a = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"],
			b = ["k"];
		while(arg--) {
			a.concat(b);
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "concat: -standard",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var a = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"],
			b = ["k", "i", "j", "l", "m"];
		while(arg--) {
			a.concat(b);
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "slice: -inx-1",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var a = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"];
		while(arg--) {
			a.slice(1);
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "slice: -inx-5",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var a = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"];
		while(arg--) {
			a.slice(5);
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "slice: -inx-9",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var a = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"];
		while(arg--) {
			a.slice(9);
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "shift: -small",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		while(arg--) {
			["a", "b", "c", "d"].shift();
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "shift: -standard",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		while(arg--) {
			["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"].shift();
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "clone: -small",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = ["a", "b", "c", "d"];
		while(arg--) {
			arr.clone();
		}
	}
});

Performance.registerTest({
	group: "js.array",
	name: "clone: -standard",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"];
		while(arg--) {
			arr.clone();
		}
	}
});